<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['环卫管理','单次称重明细[RFID]']" icon="fa fa-cube"
			class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
					<h2>单次称重明细[RFID]</h2>
				</header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width: calc(100% - 220px);">
								<sa-company-tree-car companyTreeId="companyTree"
									tcarNumberSelect2="searchCarNumberSelect2"
									(companySelected)="companySelected($event)" wrapId="content" [isShowCarSort]="false"
									[isShowCarNum]="true"></sa-company-tree-car>
								<div class="top_module">
									<span class="module_text">设备ID</span>
									<input type="text" class="module_inp top_module_select" [(ngModel)]="deviceId"
										placeholder="设备ID" />
								</div>
								<div class="top_module top_module_box" style="min-width: auto;">
									<span class="top_module_label module_text">时间类型</span>
									<select name="" class="top_module_select" [(ngModel)]="timeType"
										style="min-width: 110px;">
										<option value="1">称重时间</option>
										<option value="2">创建时间</option>
									</select>
								</div>
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)"
										[specifyTime]="specifyTime"></table-select-date>
								</div>
								<button type="button" class="btn btn-primary" (click)="table_search()">查询</button>
								<button type="button" class="btn btn-primary" (click)="exportData()">导出</button>
								<button type="button" class="btn btn-primary" (click)="census(censusModal)">统计</button>
								<button *ngIf="isShowDataMse" type="button" class="btn btn-primary"
									(click)="showImportModal(dataManagementModal)">数据管理</button>
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()"
									class="search-input" placeholder="关键字...">
								<span class="top-search-box">
									<button class="top-search-btn" type="button" (click)="table_search()"> <i
											class="fa fa-search"></i></button>
								</span>
							</div>
						</div>
						<div class="table_scroll">
							<table
								class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>RFID</th>
										<th>车牌号码</th>
										<th>设备ID</th>
										<th>单桶重量</th>
										<th>称重时间</th>
										<th>地址</th>
										<th>GPS时间</th>
										<th>坐标</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" class="huanding">
										<td>{{row.rfid}}</td>
										<td>{{row.carNumber}}</td>
										<td>{{row.deviceId}}</td>
										<td>
											<div style="display: flex; align-items: center;">
												<!-- 0：净，1：毛，2：皮 -->
												<img *ngIf="row.type===0" src="assets/img/weightIcon/jing.png" title="净重"
													style="width: 28px;margin-right: 4px;" />
												<img *ngIf="row.type===1" src="assets/img/weightIcon/mao.png" title="毛重"
													style="width: 28px;margin-right: 4px;" />
												<img *ngIf="row.type===2" src="assets/img/weightIcon/pi.png" title="皮重"
													style="width: 28px;margin-right: 4px;" />
												{{row.weight}}
											</div>

										</td>
										<td>{{row.carUploadDate}}</td>
										<td>{{row.address}}</td>
										<td>{{row.gpsUploadDate}}</td>
										<td>
											<span *ngIf="row.lng&&row.lat">
												{{row.lng}},{{row.lat}}
											</span>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1"
								(onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i
									class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	<!--  统计-->
	<div bsModal #censusModal="bs-modal" id="lgModal" class="modal fade" tabindex="-1" role="dialog"
		aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg" style="width: 1000px;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="lgModalhide(censusModal)" aria-label="Close"><span
							aria-hidden="true">&times;</span></button>
					<h4 class="modal-title">数据统计</h4>
				</div>
				<div class="modal-body">
					<div class="row">
						<form class="form form-inline " role="form">
							<div class="row">
								<div class="form-group clearfix">
									<div class="col-sm-5 cont">
										<label class="control-label col-sm-4 no-padding-right">车牌号码:</label>
										<span class="col-sm-8 no-padding-right">{{carNumber}}</span>
									</div>
									<div class="col-sm-7 cont">
										<label class="control-label col-sm-4 no-padding-right">时间区间:</label>
										<span
											class="col-sm-8 no-padding-right">{{startTime_table}}--{{endTime_table}}</span>
									</div>
								</div>
								<div class="form-group clearfix">
									<div class="col-sm-5 cont">
										<label class="control-label col-sm-4 no-padding-right">总重量:</label>
										<span class="col-sm-8 no-padding-right">{{censusData.totalWeight}}</span>
									</div>
									<div class="col-sm-7 cont">
										<label class="control-label col-sm-4 no-padding-right">总条数:</label>
										<span class="col-sm-8 no-padding-right">{{censusData.num}}</span>
									</div>
								</div>
								<div class="form-group clearfix">
									<div class="col-sm-5 cont">
										<label class="control-label col-sm-4 no-padding-right">最大值:</label>
										<span class="col-sm-8 no-padding-right">{{censusData.maxWeight}}</span>
									</div>
									<div class="col-sm-7 cont">
										<label class="control-label col-sm-4 no-padding-right">最小值:</label>
										<span class="col-sm-8 no-padding-right">{{censusData.minWeight}}</span>
									</div>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--弹窗end-->
	<!-- 数据管理弹框 -->
	<div bsModal #dataManagementModal="bs-modal" class="modal fade" id="dataManagementModal" tabindex="-1" role="dialog"
		aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header" style="position: relative;">
					<button type="button" class="close" (click)="cancelUp(dataManagementModal)" aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title">上传Excel文件</h4>
					<div class="importBtn">
						<button type="button" class="btn btn-primary" (click)="load_module()">下载模板</button>
					</div>
					<div class="importBtn dataDeleteBtn">
						<button type="button" class="btn btn-primary" (click)="dataDelete()">数据删除</button>
					</div>
				</div>
				<div class="modal-body">

					<div class="row">
						<form class="form form-inline " role="form">
							<div class="row">
								<div class="col-sm-10" style="padding: 0;">
									<div class="clearfix module_line">
										<button type="button" class="btn btn-primary"
											style="width: 120px;margin-bottom: 12px;">上传模板文件
											<input type="file" class="up" (change)="fileChange($event.target.files)"
												name="fileToUpload" (click)='clearFile()' [(ngModel)]='fileUp'
												type="file" placeholder='' />
										</button>
										<br />
										<span class="row" class="note">注：请先下载模板，采用模板编辑文件后上传 (格式excel)</span>
									</div>
								</div>
							</div>
							<div *ngIf="fileToUpload">
								<label class="control-label col-sm-1"></label>
								<div>
									<ul>
										<li class="file_list"><i class="fa fa-file-text-o"
												style="margin-right: 12px;"></i>{{fileToUpload.name}}<i
												class="fa fa-check-circle green" style="margin-left: 60px;"></i></li>
									</ul>
								</div>
							</div>
						</form>
					</div>

				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" (click)="cancelUp(dataManagementModal)">取消</button>
					<button type="button" class="btn btn-primary"
						(click)="submitData(dataManagementModal,submitCheckModal, '2')">确认</button>
				</div>
			</div>
		</div>
	</div>
	<!-- 数据管理弹框 结束 -->
</div>
<style>
	.form-group {
		display: block;
		/* border: 1px solid #ccc; */
		height: 40px;
		line-height: 40px;
		margin-bottom: 5px;
	}

	.form-group .cont {
		border: 1px solid #ccc;
		text-align: left;
	}

	.form-group .cont:first-child {
		border-right: 0px;
	}

	.form-group .cont label {
		text-align: center;
	}

	/* 导入导出的样式 */
	.module_line .btn {
		position: relative;
	}

	.module_line .up {
		opacity: 0;
		position: absolute;
		height: 32px;
		width: 120px;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		cursor: pointer;
	}

	.importBtn {
		left: 130px;
		top: 8px;
		position: absolute;
	}

	.dataDeleteBtn {
		left: 235px;
	}

	.file_list {
		line-height: 32px;
		margin-top: 12px;
	}

	.huanding td {
		line-height: 30px;
	}
</style>